package com.smarthome.core.dictionary.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.smarthome.base.service.ShSmsTypeService;
import com.smarthome.core.dictionary.SmsTypeService;
import com.smarthome.domain.bean.ShSmsType;
import com.smarthome.domain.vo.boss.DataGrid;
import com.smarthome.domain.vo.boss.PageHelper;

@Service("smsTypeService")
public class SmsTypeServiceImpl implements SmsTypeService {

	@Resource
	private ShSmsTypeService shsmsTypeService;
	
	@Override
	public DataGrid queryDatagrid(ShSmsType querySmsType, PageHelper page) {
		return shsmsTypeService.queryDatagrid(querySmsType, page);
	}

	@Override
	public List<ShSmsType> querySmsType(ShSmsType querySmsType) {
		return shsmsTypeService.selectEntryList(querySmsType);
	}

	@Override
	public ShSmsType querySmsTypeById(Long id) {
		return shsmsTypeService.selectEntryById(id);
	}

	@Override
	public void add(ShSmsType smsType) {
		shsmsTypeService.saveOrUpdate(smsType);
	}

	@Override
	public void edit(ShSmsType smsType) {
		shsmsTypeService.saveOrUpdate(smsType);
	}

	@Override
	public void delete(Long id) {
		ShSmsType smsType=shsmsTypeService.selectEntryById(id);
		smsType.setIsDel(1L);
		shsmsTypeService.saveOrUpdate(smsType);
	}

}
